//---------------------------------------------------------------------------
#ifndef vLHistoriqueH
#define vLHistoriqueH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include "webhelp.h"
#include "CComboBx.h"
#include <Buttons.hpp>
#include <ImgList.hpp>
#include "CEdit.h"
//---------------------------------------------------------------------------
#define MSG_SAISIR "<Saisir une donnée à filtrer>"
#define MSG_NODATA "<Aucune donnée à filtrer>"
//---------------------------------------------------------------------------
#define COMBO_USER "User"
#define COMBO_OPE  "Operation"
#define COMBO_LOG  "Logiciel"
#define COMBO_VER  "Version"
#define COMBO_REF  "Ref"
#define COMBO_DES  "Designation"
//---------------------------------------------------------------------------
typedef struct {
    char Condition_Nom[50+1];
    char Condition_Ope[50+1];
    char Condition_Log[50+1];
    char Condition_Ver[50+1];
    char Condition_Ref[50+1];
    char Condition_Des[50+1];
    char Condition_Web[50+1];
}Filtrage;
//---------------------------------------------------------------------------
class THisto : public TForm
{
    __published:	// Composants gérés par l'EDI
    TPanel *pFilter;
        TListView *lvHistorique;
        TPanel *Panel1;
        TDateTimePicker *DateDebut;
        TDateTimePicker *DateFin;
        TLabel *Label1;
        TLabel *Label2;
        TSpeedButton *sbRaz;
    TLabel *lUtilisateur;
        TLabel *Label4;
        TLabel *Label5;
        TLabel *Label6;
        TLabel *Label7;
        TLabel *Label8;
        TLabel *Label9;
        TImageList *imgHist;
    CEdit *cWeb;
        void __fastcall lvHistoriqueDrawItem(TCustomListView *Sender,
              TListItem *Item, TRect &Rect, TOwnerDrawState State);
        void __fastcall DateFinCloseUp(TObject *Sender);
        void __fastcall DateDebutCloseUp(TObject *Sender);
        void __fastcall sbRazClick(TObject *Sender);
        void __fastcall lvHistoriqueColumnClick(TObject *Sender,
              TListColumn *Column);
        void __fastcall lvHistoriqueCompare(TObject *Sender, TListItem *Item1,
              TListItem *Item2, int Data, int &Compare);
    void __fastcall cWebExit(TObject *Sender);

    private:	// Déclarations utilisateur
        CComboBox * cbUser;
        CComboBox * cbOperation;
        CComboBox * cbLogiciel;
        CComboBox * cbVersion;
        CComboBox * cbRef;
        CComboBox * cbDesignation;

        TList * MesCombos;
        
        Filtrage m_stFiltre;
        bool m_bAfficher;
        int  m_nColumnToSort;
        int  m_nLastColumn;
        bool m_bAscToDesc;

    private:
        void __fastcall ConstruireListView( void );
        AnsiString __fastcall DefinirRequeteFiltre( const AnsiString &asCombo );
        void __fastcall RemplirFiltre( void );
        void __fastcall RemplirComboVer( void );
        AnsiString __fastcall Filtrer( void );
        void __fastcall RemplirStructure( Filtrage * stFiltre );
        void __fastcall ConstruireComposant( void );
        void __fastcall OnChangeCComboBox(TObject *Sender);
        void __fastcall OnExitCComboBox(TObject *Sender);

    public:		// Déclarations utilisateur
        __fastcall THisto(TComponent* Owner);
        __fastcall ~THisto();
        void __fastcall Afficher( const AnsiString &asFiltre );
};
//---------------------------------------------------------------------------
#endif
